package com.liohi.controller;


import com.liohi.Param.R;
import com.liohi.entity.Laboratory;
import com.liohi.service.LaboratoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@CrossOrigin
@RestController
@Api(tags = "实验室管理")
@RequestMapping("laboratory")
public class LaboratoryController {

    @Autowired
    private LaboratoryService laboratoryService;

    @ApiOperation("查询所有实验室设备")
    @GetMapping("list")
    public R getLabList(HttpServletRequest httpServletRequest){
        List<Laboratory> list = laboratoryService.list();
        return R.ok("items",list);
    }
}
